'use client'

import { ReactNode, Suspense } from 'react'
import TopNav, { TopNavBlockProps } from '@/components/top-nav'
import '@/app/global.css'
import Loading from '@/components/loading'

export default function RootLayout({
    children,
}: {
    children: ReactNode
    }) {

    const routes: TopNavBlockProps = [{
        name: '首页',
        href: '/'
    }, {
        name: '我',
        href: '/me'
    }]

    return <html lang='zh-CN'>
            <head>
                <title>瀚通启文</title>
                <meta charSet='utf-8' />
                <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            </head>
            <body>
                <TopNav blocks={routes} id='layout' />
            <Suspense fallback={<Loading />}>
                {children}
            </Suspense>
            </body>
        </html>
}